package cn.edu.cug.cs.gtl.docsrv.auth.dao;

import java.math.BigDecimal;

public interface AuthDao {

    //用户操作

    //角色操作

    //资源操作

    //用户组操作


    String getAuthUserFilters(BigDecimal userID) ;
    String getAuthUserOperators(BigDecimal  userID) ;
    String getAuthUserResources(BigDecimal  userID) ;
    String getAuthUserName(BigDecimal userID);
    BigDecimal getAuthUserId(String userName);

    default String getAuthUserFilters(String userName){
        BigDecimal userId = getAuthUserId(userName);
        if(userId!=null){
            return getAuthUserFilters(userId);
        }
        return "";
    }
    default String getAuthUserOperators(String userName) {
        BigDecimal userId = getAuthUserId(userName);
        if(userId!=null){
            return getAuthUserOperators(userId);
        }
        return "";
    }
    default String getAuthUserResources(String userName) {
        BigDecimal userId = getAuthUserId(userName);
        if(userId!=null){
            return getAuthUserResources(userId);
        }
        return "";
    }
}
